package com.chj.service;

import com.chj.feign.FeignClientConfig;
import com.chj.vo.Product;
import com.chj.vo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@FeignClient(name = "SPRINGCLOUD-MICRO-ZUUL-GATEWAY",configuration = FeignClientConfig.class,
        fallbackFactory = IZUUlClientServiceallbackFactory.class)
public interface IZUUlClientService {
    /**
     * http://localhost:9501/chj-api/product-proxy/prodcut/get/1
     * http://localhost:9501/chj-api/user-proxy/user/get/1
     * http://localhost:9501/chj-api/user2-proxy/user/get/1
     */
    // ***********************产品服务模块接口***********************
    @RequestMapping("/chj-api/product-proxy/prodcut/get/{id}")
    public Product getProduct(@PathVariable("id")long id);

    @RequestMapping("/chj-api/product-proxy/prodcut/list")
    public List<Product> listProduct() ;

    @RequestMapping("/chj-api/product-proxy/prodcut/add")
    public boolean addPorduct(Product product) ;

    // ***********************产品服务模块接口***********************
    @RequestMapping("/chj-api/user-proxy/user/get/{name}")
    public User getUser(@PathVariable("name")String name);
}
